<?php

use Illuminate\Database\Seeder;
use App\Models\Admin;
use App\Models\Role;

class AdminsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
//        $faker = Faker\Factory::create();

        $admin = new Admin();
        $admin->username = 'admin';
        $admin->password = Hash::make('admin');
        $admin->email = 'admin@domain.com';
        $admin->deleted_at = null;
        $admin->confirmed_at = \Carbon\Carbon::now();
        $admin->save();

        $admin->roles()->save(Role::find(1));

//        for ($i = 0; $i < 50; $i++) {
//            $admin = new Admin();
//            $admin->username = $faker->userName;
//            $admin->password = Hash::make('password');
//            $admin->email = $faker->safeEmail;
//            $admin->deleted_at = null;
//            $admin->confirmed_at = \Carbon\Carbon::now();
//            $admin->save();
//
//            $admin->roles()->save(Role::find(2));
//        }
    }
}
